﻿package com.snakedickgames.common.sandy 
{
    import flash.media.Camera;
    import sandy.core.scenegraph.Camera3D;
    
    
    public class SandyCamera3D extends SandyTransformable 
    {
        public var width:Number = 550;
        public var height:Number = 400;
        public var fov:Number = 45;
        public var near:Number = 50;
        public var far:Number = 10000;
        
        public function get camera():Camera3D 
        {
            return _node as Camera3D;
        }
        
        protected function createCamera():void
        {
            // override this
            node = new Camera3D(width, height, fov, near, far);
        }
                
        override protected function onAdd():void 
        {
            super.onAdd();
            if (!_node)
                createCamera();
        }
    }

}